def func(li):
    len_li = len(li)
    if len_li > 2:
        print("列表长度大于2")
        new_li = li[0:2]
    return (new_li)
res = func([12,12,324,432,4,523])
print(res)